#include "test_task.h"  
#include "cmsis_os.h"
#include "w25qxx.h"
#include "led.h"
#include "x42.h"
#include "motion.h"
uint8_t test_flag[5];
float test_pos = 0x00;
uint8_t test_num = 0x01;
uint8_t test_dir = 0x00;
uint8_t test_mod = 0x00;
const u8 TEXT_Buffer[]= {"BORING-TECH STM32 SPI TEST"};
#define SIZE sizeof(TEXT_Buffer)
u8 datatemp[SIZE];
u32 flash_size;
void TestStartTask(void const * argument)
{
	
  /* USER CODE BEGIN StartLedTask */
  /* Infinite loop */
	Emm_V5_En_Control(0x01, 1, 0);
	osDelay(100);
	Emm_V5_En_Control(0x02, 1, 0);
  for(;;)
  {
		if(test_flag[0] == 1)
		{
//			set_motor_angle(test_num, test_pos);
			Emm_V5_Pos_Control(test_num, test_dir, 100, 0, test_pos, test_mod ,0);
			set_led_status(IDLE);
			test_flag[0] = 0;
		}
		
		if(test_flag[1] == 1)
		{
			Emm_V5_Reset_CurPos_To_Zero(test_num);
			set_led_status(ERRO);
			test_flag[1] = 0;
		}
    osDelay(500);
  }
  /* USER CODE END StartLedTask */
}


